<extend name="Base/common"/>
<block name="style">
  <link  rel="stylesheet"  href="__PUBLIC__/Wap/css/css.css">
</block>
<block name="body">
	 <body  style="background:#f6f6f8;">
</block>

<block name="content">
  <section  class="wrap">
    <section  class="address">
     <div  class="addr_info">
    	<form id="form1" action="javascript:;" method="post">
    	<p  class="tips">个人信息</p>
        <ul>
        	<li><label  class="lb">姓名</label><input  id="nickname" class="ipt"  value="{$info['nickname']}"  type="text"  placeholder="请输入您的个人昵称"></li>
         <li><label  class="lb">手机号码</label><input  id="phone"  class="ipt"  value="{$info['mobile']}"  type="text"  placeholder="请输入正确手机号码"></li>
         <li><label  class="lb">街道地址</label><input  id="addr"  class="ipt"  value="{$info['address']}"  type="text"  placeholder="请输入正确街道地址"></li>
    	</ul>
    	</form>
     </div>
     <div  class="save_opt">
    	<p  id="oneSaveTips"  class="s_tips"  style="">为保证商品的到达 <span  class="fc3">请确认无误后再保存</span></p>
    	<a  id="oneSaveAddr"  href="javascript:submit1();"  title="保存"  class="chk_btn"  style="">保存</a>
     </div>
      <div style="margin-top: 6rem;">
     </div>
     </section>

    </section>

</block>


<block name="footer">
	<div class="footer" style="bottom: 0px;">
	     <ul>
	         <li class="f_home"><a href="{:U('Index/index')}" title="首页"><i class="icon iconfont">&#xe61c;</i>首页</a></li>
	         <li class="f_whole"><a href="{:U('Public/introduction')}" title="竞价介绍"><i class="icon iconfont">&#xe627;</i>竞价介绍</a></li>
	         <li class="f_personal"><a href="{:U('Agent/profile')}" class="hover" title="个人中心"><i class="icon iconfont">&#xe61e;</i>个人中心</a></li>
	     </ul>
	 </div>
</block> 


<block name="script">
 <script type="text/javascript">
	function submit1(){	    
    	var form_input = document.getElementById("form1");
    	var mobile = form_input['phone'].value;
		  var nickname = form_input['nickname'].value;
		 var  address=form_input['addr'].value;
		if (!nickname) {
			alert('请输入您的真实姓名！');
			return false;
		}
		if (!mobile) {
			alert('请输入您的手机号码！');
			return false;
		}
		if (!/^1[0-9]{1}[0-9]{9}/.test(mobile)) {
			alert('请输入正确的手机号码！');
			return false;
		}
		if (!address) {
			alert('请输入您的收货地址！');
			return false;
		}
		
		var message=confirm('请确认您的信息');
		if (message) {
        	$.post("{:U('editInfo',array('id'=>$info['uid']))}",{mobile:mobile,nickname:nickname,address:address,},function(data){
             if(data.status==1){
                    alert(data.info);
                    window.location.href="{:U('Agent/profile')}";
                }else{
                    alert(data.info);
                }
        	});
        };
    }
 </script>
</block>
